import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import AutoImport from 'unplugin-auto-import/vite'
// https://vitejs.dev/config/
export default defineConfig({
  // modify脚本中获取的env是staging 这里面读到的永远是production 可能是hbuilder bug
  // https://ask.dcloud.net.cn/question/140965
  base: process.env.npm_lifecycle_event === 'build:h5' ? '//web.asagroup.cn/asa-home/' : (process.env.npm_lifecycle_event === 'build:staging' ? '//web.yayuit.cn/asa-home/' : ''),
  plugins: [uni(),
  AutoImport({
    imports: [
      'vue',
      'vue-router',
    ],
    dts: 'src/auto-import.d.ts'
  })
  ],

});
